﻿using UnityEngine;

namespace Room
{
    class MonsterAIStateBorn:MonsterAIStateBase
    {

        protected override void OnEnter()
        {
            controller.PlayParticle(RCAIMonster.ParticleType.Born);
            controller.SwitchState(MonsterAIState.Rest);

            NavMeshHit hit;
            if (NavMesh.SamplePosition(controller.bornPosition, out hit, 10f, NavMesh.AllAreas))
            {
                controller.bornPosition = hit.position;
                controller.owner.transform.position = controller.bornPosition;
            }
        }

        protected override void OnLeave()
        {
            
        }
    }
}

